﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucBangDiem.ascx.cs" Inherits="STT.Admin.UserControls.ucBangDiem" %>
<style>
    .btnsave { 
    text-align:left;
    padding: 10px;
}
</style>
<div id="content-header">
    <div id="breadcrumb">
        <a href="../Default.aspx" class="tip-bottom" data-original-title="Về bảng điều khiển">
            <i class="icon-home"></i>Trang chủ
        </a>
        <a href="../Admin/Default.aspx?" class="current">Quản lý khóa-lớp học</a>
        <a href="../Admin/Default.aspx?" class="current">Quản lý điểm</a>
    </div>
</div>
    <asp:Panel ID="pnbangdiem" runat="server" Visible="false">
    <div class="widget-box">
        <div class="widget-title">
            <span class="icon"><i class="icon-th"></i></span>
            <h5>Chọn lớp để chỉnh sửa điểm học viên</h5>
             <div id="Div1" class="Backedit">
                <asp:Button ID="btnxemdsdiem" runat="server" Text="Danh sách điểm học viên" CssClass="btn btn-info" OnClick="btnxemdsdiem_Click" Height="36px" />
            </div>
        </div>
        <div class="widget-content nopadding">
            <div class="modal-body" style="width: 42%;float:left">
            <div class="control-group">
                <label class="control-label">Chọn khóa học: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlKhoaHoc" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlKhoaHoc_SelectedIndexChanged"></asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ErrorMessage="*" ControlToValidate="ddlKhoaHoc" InitialValue="-1" ForeColor="Red" ToolTip="Bạn chưa chọn khóa học!" ValidationGroup="ddl"
                        runat="server" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">Chọn lớp học: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlLopHoc" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlLopHoc_SelectedIndexChanged">
                        <asp:ListItem>---------Chọn---------</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ErrorMessage="*" ControlToValidate="ddlLopHoc" InitialValue="-1" ForeColor="Red" ToolTip="Bạn chưa chọn lớp học!" ValidationGroup="ddl"
                        runat="server" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">Chọn môn học: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlMonHoc" runat="server">
                        <asp:ListItem>---------Chọn---------</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" ErrorMessage="*" ControlToValidate="ddlMonHoc" InitialValue="-1" ForeColor="Red" ToolTip="Bạn chưa chọn môn học!" ValidationGroup="ddl"
                        runat="server" />
                </div>
            </div>
            </div>
            <div class="modal-body" style="width: 42%;float:left">
            <div class="control-group">
                <label class="control-label">Chọn loại điểm: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlLoaiDiem" runat="server">
                        <asp:ListItem Value="0">--------Loại điểm--------</asp:ListItem>
                        <asp:ListItem Value="1">Điểm chuyên cần</asp:ListItem>
                        <asp:ListItem Value="2">Điểm kiểm tra</asp:ListItem>
                        <asp:ListItem Value="3">Điểm thi</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" ErrorMessage="*" ControlToValidate="ddlLoaiDiem" InitialValue="-1" ForeColor="Red" ToolTip="Bạn chưa chọn loại điểm!" ValidationGroup="ddl"
                        runat="server" />
                </div>
            </div>
            <div class="control-group">
                <div class="controls">
                    <asp:Button ID="btSuaDiem" runat="server" CssClass="btn btn-primary" Text="Sửa điểm" ValidationGroup="ddl"
                        OnClick="btnthemdiem_Click" />
                </div>
            </div>
            </div> 
        </div>
    </div>
    <div class="widget-box">
        <div class="widget-title">
            <span class="icon"><i class="icon-th"></i></span>
            <h5>
            <asp:Label ID="lbltieude" runat="server" Text="Danh sách điểm học viên"></asp:Label></h5>
            <div id="search">
                <asp:TextBox ID="txtTimKiem" runat="server" placeholder="Nhập từ tìm kiếm..."></asp:TextBox>
                <button class="tip-left" data-original-title="tìm kiếm">
                    <asp:imagebutton id="btsearch" runat="server" imageurl="~/img/icon-search.png" style="width: 16px" CausesValidation="false" />
                </button>
            </div>
        </div>
        <div class="widget-content nopadding">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
             <asp:Panel ID="pn_dsHV" runat="server" Visible="false">
             <asp:Panel ID="pnDetail" runat="server">
            <div class="" style="padding:10px;">
               <div class="col-md-7" style="text-align:left">
                   <asp:Label ID="label114" runat="server" Text="Môn học :" Font-Bold="true"></asp:Label>
                   <asp:Label ID="lblmonhoc" runat="server" Text="DTNH1"></asp:Label>&nbsp&nbsp&nbsp&nbsp
                   <asp:Label ID="Label11" runat="server" Text="Tên lớp :" Font-Bold="true"></asp:Label>
                   <asp:Label ID="lbltenlop" runat="server" Text="DTNH1"></asp:Label>&nbsp&nbsp&nbsp&nbsp
                   <asp:Label ID="Label9" runat="server" Text="Mã giảng viên :" Font-Bold="true"></asp:Label>
                   <asp:Label ID="lblMaGV" runat="server" Text="DTNH1" ></asp:Label>&nbsp&nbsp&nbsp&nbsp
                   <asp:Label ID="Label3" runat="server" Text="Tên giảng viên :" Font-Bold="true"></asp:Label>
                   <asp:Label ID="lblgiangvien" runat="server" Text="DTNH1"></asp:Label>
               </div>
            </div>
          </asp:Panel>
             <div class="btnsave">
              <asp:Label ID="Label7" runat="server" Text="Chú ý : Điểm học viên nhập vào chỉ nằm trong khoảng từ 0 tới 10" ForeColor="Red">
              </asp:Label>
             </div>
             <div class="modal-body" style="border-bottom:thin; border-bottom-style: solid; border-bottom-color: #CCCCCC;">   
             <asp:GridView ID="GvDiemHV" runat="server" CssClass="table table-bordered table-hover"
                    AutoGenerateColumns="False" DataKeyNames="Mahv" AllowPaging="True"
                     OnPageIndexChanging="gvDiemHV_PageIndexChanging" PageSize="100" OnRowDataBound="GvDiemHV_RowDataBound" >
                   <Columns>
                        <asp:TemplateField HeaderText="Số thứ tự" 
                            SortExpression="SoThuTu">
                            <ItemTemplate>
                               <%# Container.DataItemIndex + 1 %>
                                 <asp:Label ID="lblMamh" runat="server" 
                                    Text='<%# Eval("MaMonHoc") %>' Visible="false"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="span1" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="TenHV" HeaderText="Họ Tên"
                            SortExpression="TenHV" ItemStyle-CssClass="span2">
                            <ItemStyle CssClass="span2"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="Ten" HeaderText="Tên"
                            SortExpression="Ten" ItemStyle-CssClass="span2">
                            <ItemStyle CssClass="span2"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Điểm chuyên cần"
                            SortExpression="DiemChuyenCan">
                            <ItemTemplate>
                                 <asp:TextBox ID="txtdiemcc" runat="server" CssClass="point" Text='<%# Eval("DiemChuyenCan") %>' Width="40px"></asp:TextBox>
                            </ItemTemplate>
                            <ItemStyle CssClass="span1" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Điểm kiểm tra" 
                            SortExpression="DiemKiemTra">
                            <ItemTemplate>
                                 <asp:TextBox ID="txtdiemkt" runat="server" CssClass="point" Text='<%# Eval("DiemKT") %>' Width="40px"></asp:TextBox>
                            </ItemTemplate>
                            <ItemStyle CssClass="span1" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Điểm thi" 
                            SortExpression="DiemThiLan1">
                            <ItemTemplate>
                                 <asp:TextBox ID="txtDiemTL1" runat="server" CssClass="point" Text='<%# Eval("DiemTL1") %>' Width="40px"></asp:TextBox>
                            </ItemTemplate>
                            <ItemStyle CssClass="span1" />
                        </asp:TemplateField>
                       <asp:TemplateField HeaderText="Điểm tổng kết" 
                            SortExpression="DiemTongKet">
                            <ItemTemplate>
                                     <asp:Label ID="Label1" runat="server" Text='<%# Eval("DiemTK") %>' CssClass="point"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="span1" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
             </div>
            <div class="btnsave">
                &nbsp&nbsp&nbsp
                <asp:Button ID="btnluudiem" runat="server" Text="Lưu điểm" CssClass="btn btn-primary" Width="100px" OnClick="btnluudiem_Click" Height="35px" />
            </div>   
        </asp:Panel>
        </div>
        </div>
    </div>
    </asp:Panel>
    <asp:Panel ID="pnDSMonHoc" runat="server" Visible="true">
    <div class="widget-box">
        <div class="widget-title">
            <span class="icon"><i class="icon-th"></i></span>
            <h5>Chọn lọc để xem danh sách môn học</h5>
            <div id="Backedit" class="Backedit">
                <asp:Button ID="btnBackEdit" runat="server" Text="Chỉnh sửa điểm học viên" CssClass="btn btn-info" OnClick="btnBackEdit_Click" Height="36px"/>
            </div>
        </div>
        <div class="widget-content nopadding">
           <div class="modal-body" style="width: 42%;float:left">
            <div class="control-group">
                <label class="control-label">Chọn khóa học: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlkhoahoc2" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlKhoahoc2_SelectedIndexChanged"></asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ErrorMessage="*" ControlToValidate="ddlKhoaHoc2" InitialValue="-1" ForeColor="Red" ToolTip="Bạn chưa chọn khóa học!" ValidationGroup="ddl2"
                        runat="server" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">Chọn lớp học: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddllophoc2" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddllophoc2_SelectedIndexChanged">
                        <asp:ListItem>---------Chọn---------</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" ErrorMessage="*" ControlToValidate="ddllophoc2" InitialValue="-1" ForeColor="Red" ToolTip="Bạn chưa chọn lớp học!" ValidationGroup="ddl2"
                        runat="server" />
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">Chọn môn học: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlmonhoc2" runat="server" OnSelectedIndexChanged="ddlmonhoc2_SelectedIndexChanged">
                        <asp:ListItem>---------Chọn---------</asp:ListItem>
                    </asp:DropDownList>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator10" ErrorMessage="*" ControlToValidate="ddlmonhoc2" InitialValue="-1" ForeColor="Red" ToolTip="Bạn chưa chọn môn học!" ValidationGroup="ddl2"
                        runat="server" />
                </div>
            </div>            
            <div class="control-group">
                <div class="controls">
                    <asp:Button ID="btnxemdsmonhoc" runat="server" CssClass="btn btn-primary" Text="Xem danh sách" ValidationGroup="ddl2"
                        OnClick="btnxemdsmonhoc_Click" />
                </div>
            </div>
           </div>
            <div class="modal-body" style="width: 42%;float:left">
                <div class="control-group">
                <label class="control-label">Chọn giảng viên : </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlGiangvien" runat="server" OnSelectedIndexChanged="ddlGiangvien_SelectedIndexChanged" AutoPostBack="true">
                        <asp:ListItem>---------Chọn---------</asp:ListItem>
                    </asp:DropDownList>
                </div>
            </div>
            </div>
        </div>
        <div style="clear:both"></div>
    </div>
    <div class="widget-box">
        <div class="widget-title">
        <span class="icon"><i class="icon-th"></i></span>
        <h5>
        <asp:Label ID="Label5" runat="server" Text="Danh các môn học của các lớp"></asp:Label></h5>
        <div id="search2">
            <asp:TextBox ID="txttimkiem2" runat="server" placeholder="Nhập từ tìm kiếm..."></asp:TextBox>
            <button class="tip-left" data-original-title="tìm kiếm">
                <asp:imagebutton id="Imagebutton1" runat="server" imageurl="~/img/icon-search.png" style="width: 16px" CausesValidation="false" />
            </button>
        </div>
        </div>
        <div class="widget-content nopadding">
        <div id="Div2" class="dataTables_wrapper" role="grid">
          <asp:Panel ID="pn_DSMonHoc" runat="server">
          <asp:GridView ID="gvDSMonHoc" runat="server" CssClass="table table-bordered"
                AutoGenerateColumns="False" DataKeyNames="MaMonHoc" AllowPaging="True"
                 OnPageIndexChanging="gvDSMonHoc_PageIndexChanging" PageSize="10" >
                <Columns>
                    <asp:TemplateField HeaderText="Số thứ tự" 
                        SortExpression="SoThuTu">
                        <ItemTemplate>
                           <%# Container.DataItemIndex + 1 %>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" />
                    </asp:TemplateField>
                     <asp:TemplateField HeaderText="Môn học"
                        SortExpression="TenMonHoc">
                        <ItemTemplate>
                            <asp:Label ID="lblmalop" runat="server" 
                                Text='<%# Eval("Malop") %>' Visible="false"></asp:Label>
                             <asp:Label ID="lblmamh" runat="server" 
                                Text='<%# Eval("MaMonHoc") %>' Visible="false"></asp:Label>
                            <asp:Label ID="lbltenlop" runat="server" 
                                Text='<%# Eval("TenLop") %>' Visible="false"></asp:Label>
                        <asp:LinkButton ID="btntemh" runat="server" Text='<%# Eval("TenMonHoc") %>' Font-Underline="true" ForeColor="#0000ff" OnClick="btntemh_Click"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="span2" />
                    </asp:TemplateField>
                    <asp:BoundField DataField="TenLop" HeaderText="Tên Lớp"
                        SortExpression="TenLop" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Số tiết" 
                        SortExpression="Sotiet">
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" 
                                Text='<%# Eval("Sotiet") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" />
                    </asp:TemplateField>
                     <asp:TemplateField HeaderText="Giáo viên giảng dạy" 
                        SortExpression="GiaoVienGiangDay">
                        <ItemTemplate>
                            <asp:Label ID="lblgiangvien" runat="server" 
                                Text='<%# Eval("TenGV") %>'></asp:Label>
                             <asp:Label ID="LabelMaGV" runat="server" 
                                Text='<%# Eval("MaGV") %>' Visible="false"></asp:Label>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" />
                    </asp:TemplateField>
                      <asp:TemplateField HeaderText="Số sinh viên" 
                        SortExpression="Sosinhvien">
                        <ItemTemplate>
                            <asp:Label ID="Label4" runat="server" 
                                Text='<%# Eval("Siso") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" />
                    </asp:TemplateField>
                      <asp:TemplateField HeaderText="Export" 
                        SortExpression="Export">
                        <ItemTemplate>
           <asp:HyperLink ID="btnexport" CssClass="btn btn-primary" Target="_blank" NavigateUrl='<%#"~/Report/DSDiemHVAdmin.aspx?ml=" + Eval("MaLop") +"&tl="+ Eval("TenLop")+"&mm="+Eval("MaMonHoc")+"&mg="+Eval("MaGV")  %>' runat="server">                                     Export
                </asp:HyperLink>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" />
                    </asp:TemplateField>
                </Columns>
             <HeaderStyle  Font-Size="13px" ForeColor="Black"/>
            </asp:GridView>
          </asp:Panel>
          <asp:Panel ID="pn_DSDiemHV" runat="server" Visible="false">
            <asp:Panel ID="Pn_DiemHVCT" runat="server">
            <div class="" style="padding:10px;" runat="server" id="DivHeadHVCT">
               <div class="col-md-7" style="text-align:left">
                   <asp:Label ID="label8" runat="server" Text="Môn học :" Font-Bold="true"></asp:Label>
                   <asp:Label ID="lblmonhoc2" runat="server" Text="DTNH1"></asp:Label>&nbsp&nbsp&nbsp&nbsp
                   <asp:Label ID="Label10" runat="server" Text="Tên lớp :" Font-Bold="true"></asp:Label>
                   <asp:Label ID="lbltenlop2" runat="server" Text="DTNH1"></asp:Label>
                   <asp:Label ID="lblMaLop2" runat="server" Text="" Visible="false"></asp:Label>
                   &nbsp&nbsp&nbsp&nbsp
                   <asp:Label ID="Label6" runat="server" Text="Tên giảng viên :" Font-Bold="true"></asp:Label>
                   <asp:Label ID="lblgiangvien2" runat="server" Text="DTNH1"></asp:Label>&nbsp&nbsp&nbsp&nbsp
                   <asp:Label ID="Label12" runat="server" Text="Mã giảng viên :" Font-Bold="true"></asp:Label>
                   <asp:Label ID="lblMaGV2" runat="server" Text="DTNH1"></asp:Label>
                   <asp:Label ID="lblMaMH2" runat="server" Text="" Visible="false"></asp:Label>
               </div>
            </div>
             <div class="modal-body" style="border-bottom:thin; border-bottom-style: solid; border-bottom-color: #CCCCCC;">   
             <asp:GridView ID="gv_dsDiemHV" runat="server" CssClass="table table-bordered table-hover"
                    AutoGenerateColumns="False" DataKeyNames="Mahv" AllowPaging="True"
                    PageSize="100" >
                   <Columns>
                        <asp:TemplateField HeaderText="Số thứ tự" 
                            SortExpression="SoThuTu">
                            <ItemTemplate>
                               <%# Container.DataItemIndex + 1 %>
                                 <asp:Label ID="lblMamh" runat="server" 
                                    Text='<%# Eval("MaMonHoc") %>' Visible="false"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="span1" />
                        </asp:TemplateField>
                        <asp:BoundField DataField="TenHV" HeaderText="Họ Tên"
                            SortExpression="TenHV" ItemStyle-CssClass="span2">
                            <ItemStyle CssClass="span2"></ItemStyle>
                        </asp:BoundField>
                        <asp:BoundField DataField="Ten" HeaderText="Tên"
                            SortExpression="Ten" ItemStyle-CssClass="span2">
                            <ItemStyle CssClass="span2"></ItemStyle>
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Điểm chuyên cần"
                            SortExpression="DiemChuyenCan">
                            <ItemTemplate>
                                <asp:Label ID="Label13" runat="server" Text='<%# Eval("DiemChuyenCan") %>'></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="point" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Điểm kiểm tra" 
                            SortExpression="DiemKiemTra">
                            <ItemTemplate>
                                <asp:Label ID="Label14" runat="server" Text='<%# Eval("DiemKT") %>'></asp:Label>  
                            </ItemTemplate>
                            <ItemStyle CssClass="point" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Điểm thi" 
                            SortExpression="DiemThiLan1">
                            <ItemTemplate>
                                <asp:Label ID="Label15" runat="server" Text='<%# Eval("DiemTL1") %>' ></asp:Label> 
                            </ItemTemplate>
                            <ItemStyle CssClass="point" />
                        </asp:TemplateField>
                       <asp:TemplateField HeaderText="Điểm tổng kết" 
                            SortExpression="DiemTongKet">
                            <ItemTemplate>
                                  <asp:Label ID="Label1" runat="server" Text='<%# Eval("DiemTK") %>' CssClass="point"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle CssClass="point" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
             </div>
             <div style="padding:10px;" >
                   <asp:HyperLink ID="btnexportCT" CssClass="btn btn-primary" Target="_parent" runat="server">           
                       Export
                </asp:HyperLink>
               
                 <asp:Button ID="btnback" runat="server" Text="Quay lại" Visible="true" CssClass="btn btn-primary" OnClick="btnback_Click" />
             </div>
             </asp:Panel>
            </asp:Panel>
        </div>
        </div>
    </div>
    <div style="clear:both"></div>
    </asp:Panel>
<script type="text/javascript">

    function Validate() {
        var isValid = false;
        isValid = Page_ClientValidate('ddl');
        if (isValid) {
            isValid = Page_ClientValidate('error');
        }
        return isValid;
    }
</script>
